#ifndef __TWO_WHEELS_ROBOT_CONTROLLER__
#define __TWO_WHEELS_ROBOT_CONTROLLER__

typedef float veclocity_t; /* m/s */
typedef float omega_t;     /* rads/s */
typedef float position_t   /* m */
typedef float angle_t      /* radian */

struct x_position {
    position_t x;
    position_t y;
    angle_t angle;
};

enum x_robot_semantics {

};

struct x_v_omega_handle {
    unsigned long ref_count;
    veclocity_t veclocity;
    omega_t omega;
    struct x_position *origin_position;
    struct x_position *next_position;
    unsigned long (*done_callback)(struct x_v_omega_handle * handle);
};

extern struct x_v_omega_handle *v_omega_init(struct x_robot_semantics seman, unsigned long time_scale);
extern unsigned long v_omega_release( struct x_v_omega_handle *handle);
extern unsigned long v_omega_set_speed(struct x_v_omega_handle *handle, veclocity_t veclocity);
extern veclocity_t v_omega_get_speed(struct x_v_omega_handle *handle);

extern unsigned long v_omega_set_omega(struct x_v_omega_handle *handle, omega_t omega);
extern omega_t v_omega_get_omega(struct x_v_omega_handle handle);

extern unsigned long v_omega_set_position(struct x_v_omega_handle *handle, struct x_position position);
extern struct x_position *v_omega_get_position(struct x_v_omega_handle *handle);

extern unsigned long v_omega_start_control(struct x_v_omega_handle *handle, veclocity_t v, unsigned long v_time, omega_t omega, unsigned long ome_time);
extern unsigned long v_omega_stop_control(struct x_v_omega_handle *handle);
extern unsigned long v_omega_drive_straight(struct x_v_omega_handle *handle, position_t meter, veclocity_t v);
extern unsigned long v_omega_drive_turn(struct x_v_omega_handle *handle, angle_t radians, omega_t w);

extern unsigned long v_omega_drive_curve(struct x_v_omega_handle *handle, position_t meter, angle_t radians, unsigned long exe_time);

extern unsigned long v_omega_drive_remain(struct x_v_omega_handle *handle);

extern unsigned long v_omega_is_done(struct x_v_omega_handle *handle);

#endif // __TWO_WHEELS_ROBOT_CONTROLLER__